// @/assets/styles/markdown-content.scss

.markdown-content {
  line-height: 1.6;
  text-align: left; // 确保所有文字左对齐

  /* 标题样式 */
  h1, h2, h3, h4, h5, h6 {
    margin-top: 24px;
    margin-bottom: 16px;
    font-weight: 600;
    line-height: 1.25;
  }

  h1 { font-size: 2em; }
  h2 { font-size: 1.5em; }
  h3 { font-size: 1.25em; }

  /* 段落样式 */
  p {
    margin-bottom: 16px;
  }

  /* 代码块样式 */
  pre {
    position: relative;
    padding: 16px;
    padding-top: 30px;
    overflow: auto;
    font-size: 85%;
    line-height: 1.45;
    background-color: #f6f8fa;
    border: 1px solid #000;
    border-radius: 6px;
    margin-bottom: 16px;

    /* 语言标签 */
    &::before {
      content: attr(data-language);
      position: absolute;
      top: 0;
      right: 60px;
      padding: 2px 6px;
      font-size: 12px;
      color: #666;
      background-color: #f0f0f0;
      border-bottom-left-radius: 4px;
      border-bottom-right-radius: 4px;
    }

    /* 复制按钮样式 */
    .copy-button {
      position: absolute;
      top: 0;
      right: 0;
      padding: 2px 6px;
      font-size: 12px;
      color: #666;
      background-color: #f0f0f0;
      border: none;
      border-bottom-left-radius: 4px;
      cursor: pointer;
      transition: background-color 0.3s;

      &:hover {
        background-color: #e0e0e0;
      }
    }
  }

  /* 行内代码样式 */
  code {
    padding: 0.2em 0.4em;
    margin: 0;
    font-size: 85%;
    background-color: rgba(27,31,35,0.05);
    border-radius: 3px;
  }

  /* 代码块内的代码样式 */
  pre > code {
    padding: 0;
    margin: 0;
    font-size: 100%;
    word-break: normal;
    white-space: pre;
    background: transparent;
    border: 0;
  }

  /* 列表样式 */
  ul, ol {
    padding-left: 2em;
    margin-bottom: 16px;
  }

  /* 图片样式 */
  img {
    max-width: 100%;
    box-sizing: content-box;
    background-color: #fff;
  }

  /* 表格样式 */
  table {
    display: block;
    width: 100%;
    overflow: auto;
    margin-bottom: 16px;

    th, td {
      padding: 6px 13px;
      border: 1px solid #dfe2e5;
    }

    tr {
      background-color: #fff;
      border-top: 1px solid #c6cbd1;
    }

    tr:nth-child(2n) {
      background-color: #f6f8fa;
    }
  }

  /* 引用样式 */
  blockquote {
    padding: 0 1em;
    color: #6a737d;
    border-left: 0.25em solid #dfe2e5;
    margin-bottom: 16px;
  }
}